import api from '../index'

export default {
  list: (data: any) => api.get(`/system/user/listR`, {
    params: {
      nickName: data.nickName,
      phonenumber: data.phonenumber,
      pageSize: data.size,
      pageNum: data.page,
      schoolName: data.schoolName,
    },
  }),
  detail: (id: number | string) => api.get(`/system/user/getInfo`, {
    params: {
      userId: id,
    },
  }),
  create: (data: any) => api.post('/system/user/add', data, {
  }),
  resetPwd: (data: any) => api.post('/system/user/resetPwd', data, {
  }),
  changeStatus: (data: any) => api.post('/system/user/changeStatus', data, {
  }),
  edit: (data: any) => api.post('/system/user/edit', data, {
  }),

  delete: (id: number | string) => api.get(`/system/user/del`, {
    params: {
      userId: id,
    },
  }),
  uploadAvatar: (file: any) => api.post(`/common/uploadAvatar`, file, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  }),
  getSchoolList: () => api.get('/system/school/SchoolNamelist'), //  获取学校列表
  getRoleList: () => api.get('/system/role/lists'), //  获取学校列表
}
